//
//  AppDelegate.swift
//  微博
//
//  Created by xm on 2018/3/17.
//  Copyright © 2018年 xm. All rights reserved.
//

import UIKit
import AFNetworking
import SVProgressHUD

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        // 8.0以后都要向用户申请通知权限
        let notifySeeings=UIUserNotificationSettings(types: [.alert,.badge,.sound], categories: nil)
        application.registerUserNotificationSettings(notifySeeings)
        
        window = UIWindow()
        window?.backgroundColor=UIColor.white
        window?.rootViewController=MainViewController()
        window?.makeKeyAndVisible()
        
        configApp();
        
        return true
    }
}


extension AppDelegate{
    
    func configApp(){
        //设置SVProgressHUD 最小解除时间
        SVProgressHUD.setMinimumDismissTimeInterval(1)
        //设置显示网络加载指示器
        AFNetworkActivityIndicatorManager.shared().isEnabled=true
    }
    
}

